home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wsc4vb24 / wsc4vb_r.txt < prev    next >
Encoding:
Text File  |  1999-06-02  |  58.8 KB  |  1,802 lines

  1.  
  2.  
  3.  
  4.                       Windows Standard Communications
  5.  
  6.                            Library for Visual Basic
  7.  
  8.                                  (WSC4VB)
  9.  
  10.  
  11.                              REFERENCE MANUAL
  12.  
  13.  
  14.  
  15.                                Version 2.4
  16.  
  17.                                June 1, 1999
  18.  
  19.  
  20.  
  21.  
  22.                      This software is provided as-is.
  23.               There are no warranties, expressed or implied.
  24.  
  25.  
  26.  
  27.  
  28.                            Copyright (C) 1999
  29.                            All rights reserved
  30.  
  31.  
  32.  
  33.  
  34.                            MarshallSoft Computing, Inc.
  35.                            Post Office Box 4543
  36.                            Huntsville AL 35815
  37.  
  38.                            Voice : 256-881-4630
  39.                              FAX : 256-880-0925
  40.                            email : info@marshallsoft.com
  41.                              web : www.marshallsoft.com
  42.  
  43.  
  44.                                _______
  45.                           ____|__     |                (R)
  46.                        --+       |    +-------------------
  47.                          |   ____|__  |  Association of
  48.                          |  |       |_|  Shareware
  49.                          |__|   o   |    Professionals
  50.                        --+--+   |   +---------------------
  51.                             |___|___|    MEMBER
  52.  
  53.  
  54.  
  55.  
  56.       MARSHALLSOFT is a registered trademark of MarshallSoft Computing.
  57.  
  58.  
  59.  
  60.      WSC4VB Reference Manual                                   Page 1
  61.  
  62.                             C O N T E N T S
  63.  
  64.  
  65.  
  66.         Chapter                                     Page
  67.  
  68.         Table of Contents.............................2
  69.  
  70.         WSC Functions.................................4
  71.  
  72.            SioBaud....................................4
  73.            SioBrkSig..................................4
  74.            SioCTS.....................................5
  75.            SioDCD.....................................5
  76.            SioDone....................................6
  77.            SioDSR.....................................6
  78.            SioDTR.....................................7
  79.            SioEvent...................................7
  80.            SioFlow....................................8
  81.            SioGetc....................................8
  82.            SioGets....................................9
  83.            SioInfo....................................9
  84.            SioParms..................................10
  85.            SioPutc...................................10
  86.            SioPuts...................................11
  87.            SioRead...................................11
  88.            SioReset..................................12
  89.            SioRI.....................................12
  90.            SioRTS....................................13
  91.            SioRxClear................................13
  92.            SioRxQue..................................14
  93.            SioStatus.................................14
  94.            SioTimer..................................15
  95.            SioTxClear................................15
  96.            SioTxQue..................................16
  97.            SioUnGetc.................................16
  98.            SioWinError...............................17
  99.  
  100.         WSC Error Codes..............................17
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.      WSC4VB Reference Manual                                   Page 2
  121.  
  122.                             C O N T E N T S
  123.  
  124.                               (continued)
  125.  
  126.  
  127.  
  128.         Chapter                                     Page
  129.  
  130.         Modem I/O Functions..........................18
  131.  
  132.            mioBreak..................................18
  133.            mioDriver.................................18
  134.            mioQuiet..................................19
  135.            mioResult.................................19
  136.            mioSendTo.................................20
  137.            mioWaitFor................................20
  138.  
  139.         Xmodem/Ymodem Driver (XYDRV) Functions
  140.  
  141.            xyAbort...................................21
  142.            xyAcquire.................................21
  143.            xyDebug...................................22
  144.            xyDriver..................................22
  145.            xyGetFileName.............................23
  146.            xyGetMessage..............................23
  147.            xyGetParameter............................24
  148.            xyRelease.................................24
  149.            xySetParameter............................25
  150.            xyStartRx.................................25
  151.            xyStartTx.................................26
  152.  
  153.         XYDRV Error Codes............................26
  154.  
  155.         ASCII Driver (ASDRV) Functions
  156.  
  157.            ascAbort..................................27
  158.            ascDriver.................................27
  159.            ascGetMessage.............................28
  160.            ascGetParameter...........................28
  161.            ascInit...................................29
  162.            ascStartRx................................29
  163.            ascStartTx................................30
  164.  
  165.         ASDRV Error Codes............................30
  166.  
  167.       NOTES: DefLng is assumed for all functions unless otherwise declared.
  168.       Also note that all arguments are passed by value except for strings.
  169.       When in doubt about a function, refer to the declarations in
  170.       WSC32.BAS
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.      WSC4VB Reference Manual                                   Page 3
  181.  
  182.       +-------------+-----------------------------------------------------+
  183.       |   SioBaud   |  Sets the baud rate.                                |
  184.       +-------------+-----------------------------------------------------+
  185.  
  186.  
  187.       Syntax Function SioBaud(ByVal Port, ByVal BaudCode) As Long
  188.              ' Port     : Port selected.
  189.              ' BaudCode : Baud code or actual baud rate.
  190.  
  191.       Remark The SioBaud Function sets the baud rate without resetting
  192.              the port. It is used to change the baud rate after calling
  193.              SioReset.
  194.  
  195.              SioBaud may be called with either the actual baud rate value
  196.              or one of the baud rate codes as follows:
  197.  
  198.                Code   Rate    Name             Code   Rate   Name
  199.                  0     300    Baud300            5    9600   Baud9600
  200.                  1     600    Baud600            6   19200   Baud19200
  201.                  2    1200    Baud1200           7   38400   Baud38400
  202.                  3    2400    Baud2400           8   57600   Baud57600
  203.                  4    4800    Baud4800           9  115200   Baud115200
  204.  
  205.       Return    IE_BADID : No such port.
  206.              IE_BAUDRATE : Unsupported baud rate.
  207.  
  208.        Other See SioReset.
  209.  
  210.  
  211.  
  212.       +-------------+-----------------------------------------------------+
  213.       |  SioBrkSig  |  Asserts, cancels, or detects BREAK signal.         |
  214.       +-------------+-----------------------------------------------------+
  215.  
  216.       Syntax Function SioBrkSig(ByVal Port, ByVal PortCmd) As Long
  217.              ' Port : Port selected.
  218.              ' Cmd  : ASSERT, CANCEL, or DETECT.
  219.  
  220.       Remark The SioBrkSig Function controls the BREAK bit in the line
  221.              status register. The legal commands are:
  222.  
  223.              ASSERT_BREAK : ASC("A") to assert BREAK
  224.              CANCEL_BREAK : ASC("C") to cancel BREAK
  225.              DETECT_BREAK : ASC("D") to detect BREAK
  226.  
  227.              ASSERT_BREAK, CANCEL_BREAK, and DETECT_BREAK are defined in
  228.              WSC4VB.BAS.
  229.  
  230.       Return  IE_NOPEN : Port not opened. Call SioReset first.
  231.               IE_BADID : No such port.
  232.              WSC_RANGE : Illegal command. Expected "A", "C", or "D".
  233.                     >0 : BREAK signal detected (DETECT command only)
  234.  
  235.        Other None.
  236.  
  237.  
  238.  
  239.  
  240.      WSC4VB Reference Manual                                   Page 4
  241.  
  242.       +-------------+-----------------------------------------------------+
  243.       |   SioCTS    |  Reads the Clear to Send (CTS) modem status bit.    |
  244.       +-------------+-----------------------------------------------------+
  245.  
  246.       Syntax Function SioCTS(ByVal Port) As Long
  247.              ' Port : Port selected.
  248.  
  249.       Remark The SioCTS Function is used to detect if CTS (Clear To Send)
  250.              is set (1) or clear (0). Some Windows Win16 COMM drivers
  251.              cannot read the CTS bit correctly!
  252.  
  253.              The CTS line is used by some error correcting modems to
  254.              implement hardware flow control.  CTS is dropped by the modem
  255.              to signal the computer not to send data and is raised to
  256.              signal the computer to continue.
  257.  
  258.              Refer to the RS232/485 Serial Communications User's Manual
  259.              (ASYNC.TXT) for a discussion of flow control.
  260.  
  261.       Return IE_NOPEN : Port not opened. Call SioReset first.
  262.              IE_BADID : No such port.
  263.                     0 : CTS is clear.
  264.                    >0 : CTS is set.
  265.  
  266.        Other See SioFlow, SioDSR, SioRI, and SioDCD.
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.       +-----------+-------------------------------------------------------+
  281.       |   SioDCD  | Reads the Data Carrier Detect (DCD) modem status bit. |
  282.       +-----------+-------------------------------------------------------+
  283.  
  284.       Syntax Function SioDCD(ByVal Port) As Long
  285.              ' Port : Port selected.
  286.  
  287.       Remark The SioDCD Function is used to read the Data Carrier Detect
  288.              (DCD) modem status bit.
  289.  
  290.       Return IE_NOPEN : Port not opened. Call SioReset first.
  291.              IE_BADID : No such port.
  292.                     0 : DCD is clear.
  293.                    >0 : DCD is set.
  294.  
  295.        Other See SioDSR, SioCTS, and SioRI.
  296.  
  297.  
  298.  
  299.  
  300.      WSC4VB Reference Manual                                   Page 5
  301.  
  302.       +-------------+-----------------------------------------------------+
  303.       |   SioDone   |  Terminates further serial processing.              |
  304.       +-------------+-----------------------------------------------------+
  305.  
  306.       Syntax Function SioDone(ByVal Port) As Long
  307.              ' Port : Port selected.
  308.  
  309.       Remark The SioDone Function terminates further serial processing,
  310.              allowing other applications to use the port.
  311.  
  312.       Return IE_NOPEN : Port not opened. Call SioReset first.
  313.              IE_BADID : No such port.
  314.  
  315.        Other See SioReset.
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.       +-------------+-----------------------------------------------------+
  326.       |    SioDSR   |  Reads the Data Set Ready (DSR) modem status bit.   |
  327.       +-------------+-----------------------------------------------------+
  328.  
  329.       Syntax Function SioDSR(ByVal Port) As Long
  330.              ' Port : Port selected.
  331.  
  332.       Remark The SioDSR Function is used to detect if DSR (Data Set Ready)
  333.              is set (1) or clear (0). Some Windows Win16 COMM drivers
  334.              cannot read the DSR bit correctly!
  335.  
  336.       Return IE_NOPEN : Port not opened. Call SioReset first.
  337.              IE_BADID : No such port.
  338.                     0 : DSR is clear.
  339.                    >0 : DSR is set.
  340.  
  341.        Other See SioCTS, SioRI, and SioDCD.
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.      WSC4VB Reference Manual                                   Page 6
  361.  
  362.       +-------------+-----------------------------------------------------+
  363.       |    SioDTR   |  Set, clear, or read Data Terminal Ready (DTR).     |
  364.       +-------------+-----------------------------------------------------+
  365.  
  366.       Syntax Function SioDTR(ByVal Port, ByVal Cmd) As Long
  367.              ' Port : Port selected.
  368.              ' Cmd  : DTR command (see below).
  369.  
  370.       Remark The SioDTR Function controls the Data Terminal Ready (DTR) bit
  371.              in the modem control register.  DTR should always be set when
  372.              communicating with a modem.  Commands (defined in WSC4VB.BAS):
  373.  
  374.                   SET_LINE   : ASC("S")  to set DTR (ON)
  375.                   CLEAR_LINE : ASC("C")  to clear DTR (OFF)
  376.                   READ_LINE  : ASC("R")  to read DTR
  377.  
  378.       Return IE_NOPEN  : Port not opened. Call SioReset first.
  379.              IE_BADID  : No such port.
  380.              WSC_RANGE : Not one of "S", "C", or "R".
  381.                      0 : DTR is OFF (READ_LINE Command).
  382.                     >0 : DTR is ON (READ_LINE Command).
  383.  
  384.        Other See SioRTS.
  385.  
  386.  
  387.       +-----------+-------------------------------------------------------+
  388.       | SioEvent  |  Efficiently waits for serial event.                  |
  389.       +-----------+-------------------------------------------------------+
  390.  
  391.       SYNTAX Function SioEvent(ByVal Port, ByVal Mask)
  392.              ' Port : Port selected.
  393.              ' Mask : Event Mask (see below).
  394.  
  395.       REMARK The SioEvent function (WIN32 only) waits (blocks) until the
  396.              condition specfied in 'Mask' is satisfied. Multiple
  397.              conditions can be OR'ed together. The event masks are:
  398.  
  399.               EV_RXCHAR : A character was received.
  400.                EV_BREAK : A break signal was received.
  401.                  EV_CTS : The CTS line changed states.
  402.                  EV_DSR : The DST line changed states.
  403.                  EV_ERR : An error was detected.
  404.                 EV_RLSD : The DCD line has changed states.
  405.                 EV_RING : The RI line has been set.
  406.              EV_TXEMPTY : The TX queue has become empty.
  407.  
  408.       RETURN SioEvent does not return until the specified event occurs.
  409.  
  410.        OTHER See SioRead.
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.      WSC4VB Reference Manual                                   Page 7
  421.  
  422.       +------------+------------------------------------------------------+
  423.       |   SioFlow  |  Sets flow control.                                  |
  424.       +------------+------------------------------------------------------+
  425.  
  426.       Syntax Function SioFlow(ByVal Port, ByVal Cmd) As Long
  427.              ' Port : Port selected.
  428.              ' Cmd  : Class of flow control (see below).
  429.  
  430.       Remark The SioFlow Function is used to enable or disable hardware
  431.              flow control.  Hardware flow control uses RTS and CTS to
  432.              control data flow between the modem and the computer.  To
  433.              enable flow control, call SioFlow with Cmd set to:
  434.  
  435.                   Cmd       Flow Control
  436.                   ASC("H")  Hardware (RTS/CTS) flow control.
  437.                   ASC("S")  Software (XON/XOFF) flow control.
  438.                   ASC("N")  No flow control.
  439.  
  440.              In order for hardware flow control to work correctly, your
  441.              modem must also be configured to work with hardware flow
  442.              control, and your computer to modem cable must have RTS and
  443.              CTS wired straight through. If you enable hardware flow
  444.              control, do not modify the RTS line (by calling SioRTS). Flow
  445.              control is disabled after resetting a port.
  446.  
  447.       Return IE_NOPEN : Port not opened. Call SioReset first.
  448.              IE_BADID : No such port.
  449.             WSC_RANGE : Cannot recognize Cmd.
  450.                   -1  : Flow control disabled.
  451.                   >0  : Flow control enabled.
  452.  
  453.        Other See SioPutc
  454.  
  455.  
  456.       +------------+------------------------------------------------------+
  457.       |   SioGetc  |  Reads the next character from the serial line.      |
  458.       +------------+------------------------------------------------------+
  459.  
  460.       Syntax Function SioGetc(ByVal Port) As Long
  461.              ' Port : Port selected.
  462.  
  463.       Remark The SioGetc Function reads a byte from the selected serial
  464.              port. WSC_NO_DATA (-100) is returned if no byte is available.
  465.  
  466.  
  467.       Return    IE_NOPEN : Port not opened. Call SioReset first.
  468.                 IE_BADID : No such port.
  469.              WSC_NO_DATA : If timed out (no data available).
  470.                     >= 0 : Character read.
  471.  
  472.        Other See SioUnGetc and SioGets.
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.      WSC4VB Reference Manual                                   Page 8
  481.  
  482.       +------------+------------------------------------------------------+
  483.       |   SioGets  |  Reads the next byte buffer from the serial line.    |
  484.       +------------+------------------------------------------------------+
  485.  
  486.       Syntax Function SioGets(ByVal Port, ByVal Buffer As String,
  487.                               ByVal Cnt) As Long
  488.              ' Port   : Port selected.
  489.              ' Buffer : Receive buffer.
  490.              ' Cnt    : Number bytes wanted.
  491.  
  492.       Remark The SioGets Function reads the smaller of the number of bytes
  493.              wanted (Cnt) and the number of bytes in the receive buffer. A
  494.              zero is return if no bytes are read.
  495.  
  496.  
  497.       Return IE_NOPEN : Port not opened. Call SioReset first.
  498.              IE_BADID : No such port.
  499.                  >= 0 : Number of characters actually read.
  500.  
  501.        Other See SioUnGetc and SioPutc.
  502.  
  503.  
  504.       +-------------+-----------------------------------------------------+
  505.       |   SioInfo   |  Returns WSC4VB library information.                |
  506.       +-------------+-----------------------------------------------------+
  507.  
  508.       Syntax Function SioInfo(ByVal Cmd) As Long
  509.              ' Cmd : Command (See below).
  510.  
  511.       Remark The SioInfo Function returns an integer code corresponding to
  512.              the Cmd as follows.
  513.  
  514.                  Command    SioInfo returns
  515.                  ASC( "V")  Library version number. For example,
  516.  
  517.                             ' display WSC version
  518.                             Version = SioInfo(ASC("V"))
  519.                             C = Hex$(&HF And Version)
  520.                             Version = Version / 16
  521.                             B = Hex$(&HF And Version)
  522.                             Version = Version / 16
  523.                             A = Hex$(&HF And Version)
  524.                             PRINT "WSC Version " + A + "." + B + "." + C
  525.  
  526.       Return See remarks above.
  527.              -1 : Cannot recognize Cmd.
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.      WSC4VB Reference Manual                                   Page 9
  541.  
  542.       +-------------+-----------------------------------------------------+
  543.       |  SioParms   |  Sets parity, stop bits, and word length.           |
  544.       +-------------+-----------------------------------------------------+
  545.  
  546.       Syntax Function SioParms(ByVal Port, ByVal Parity,
  547.                                ByVal StopBits, ByVal DataBits) As Long
  548.              ' Port     : Port selected.
  549.              ' Parity   : Parity code.
  550.              ' StopBits : Stop bits code.
  551.              ' DataBits : Word length code.
  552.  
  553.       Remark The SioParms Function sets the parity, stop bits, and word
  554.              length.  If the default parity (none), stop bits (1), or word
  555.              length (8) is not acceptable, then they can be changed by
  556.              calling SioParms.  SioParms can be called either before or
  557.              after calling SioReset. See file WSC4VB.BAS.
  558.  
  559.              Use the constant values defined in WSC4VB.BAS to minimize the
  560.              chance of passing an incorrect parameter value.
  561.  
  562.                Parity : NoParity, OddParity, EvenParity,
  563.                         MarkParity, SpaceParity.
  564.              StopBits : OneStopBit, One5StopBits, TwoStopBits.
  565.              DataBits : WordLength7, WordLength8.
  566.  
  567.       Return    IE_BADID : No such port.
  568.              IE_BYTESIZE : Word length not supported.
  569.                WSC_RANGE : Parameter out of range.
  570.  
  571.        Other See SioReset.
  572.  
  573.  
  574.       +-------------+-----------------------------------------------------+
  575.       |   SioPutc   |  Transmit a character over a serial line.           |
  576.       +-------------+-----------------------------------------------------+
  577.  
  578.       Syntax Function SioPutc(ByVal Port, ByVal Chr) As Long
  579.              ' Port : Port selected.
  580.              ' Chr  : Character to send.
  581.  
  582.       Remark The SioPutc Function copies the character to the transmit
  583.              queue for subsequent transmission.
  584.  
  585.       Return IE_NOPEN : Port not opened. Call SioReset first.
  586.              IE_BADID : No such port.
  587.                     0 : No error.
  588.  
  589.        Other See SioGetc and SioFlow.
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.      WSC4VB Reference Manual                                   Page 10
  601.  
  602.       +-------------+-----------------------------------------------------+
  603.       |   SioPuts   |  Transmits a byte buffer over a serial line.        |
  604.       +-------------+-----------------------------------------------------+
  605.  
  606.       Syntax Function SioPuts(ByVal Port, ByVal Buffer As String,
  607.                               ByVal Cnt) As Long
  608.              ' Port   : Port selected.
  609.              ' Buffer : String of bytes to transmit.
  610.              ' Cnt    : Bytes in Buffer to send.
  611.  
  612.       Remark The SioPuts Function copies the characters to the transmit
  613.              queue for subsequent transmission.
  614.  
  615.  
  616.       Return IE_NOPEN : Port not opened. Call SioReset first.
  617.              IE_BADID : No such port.
  618.                  >= 0 : The number of bytes actually transmitted.
  619.  
  620.        Other See SioGetc and SioFlow.
  621.  
  622.  
  623.  
  624.       +-------------+-----------------------------------------------------+
  625.       |  SioRead    |  Read any UART port register.                       |
  626.       +-------------+-----------------------------------------------------+
  627.  
  628.       Syntax Function SioRead(ByVal Port, ByVal Register) As Long
  629.              ' Port     : Port selected.
  630.              ' Register : UART register [0 through 6].
  631.  
  632.       REMARK The SioRead function reads any of the 7 I/O ports directly,
  633.              by-passing the Windows API. Only for COM1 through COM4.
  634.  
  635.              Note that all modem and/or line status bits can also be read
  636.              using SioDTR, SioRTS, SioDCD, SioRI, SioDSR, and SioCTS. Refer
  637.              to the RS232/485 Serial Communications User's Manual
  638.              (ASYNC.TXT) for a description of the UART registers.
  639.  
  640.       Return    IE_BADID : No such port.
  641.                  IE_OPEN : Already open.
  642.                     else : Value of selected register.
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.      WSC4VB Reference Manual                                   Page 11
  661.  
  662.       +-------------+-----------------------------------------------------+
  663.       |  SioReset   |  Initialize a serial port for processing.           |
  664.       +-------------+-----------------------------------------------------+
  665.  
  666.       Syntax Function SioReset(ByVal Port, ByVal RxQueSize,
  667.                                ByVal TxQueSize) As Long
  668.              ' Port      : Port selected.
  669.              ' RxQueSize : Receive queue size.
  670.              ' TxQueSize : Transmit queue size.
  671.  
  672.       Remark The SioReset Function initializes the selected serial port.
  673.              SioReset should be called before making any other calls to
  674.              WSC4VB.  SioReset uses the parity, stop bits, and word length
  675.              value previously set if SioParm was called, otherwise the
  676.              default values (see SioParm) are used.
  677.  
  678.       Return    IE_BADID : No such port.
  679.                  IE_OPEN : Already open.
  680.                IE_MEMORY : Cannot allocate memory.
  681.              IE_HARDWARE : Hardware error.
  682.  
  683.        Other See SioBaud, SioParms, and SioDone.
  684.  
  685.       +-------------+-----------------------------------------------------+
  686.       |    SioRI    |  Reads the Ring Indicator (RI) modem status bit.    |
  687.       +-------------+-----------------------------------------------------+
  688.  
  689.       Syntax Function SioRI(ByVal Port) As Long
  690.              ' Port : Port selected.
  691.  
  692.       Remark The SioRI Function is used to read the Ring Indicator (RI)
  693.              modem status bit.
  694.  
  695.       Return IE_NOPEN : Port not opened. Call SioReset first.
  696.              IE_BADID : No such port.
  697.                     0 : RI is clear.
  698.                    >0 : RI is set (RING has occurred).
  699.  
  700.        Other See SioDSR, SioCTS, and SioDCD.
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.      WSC4VB Reference Manual                                   Page 12
  721.  
  722.       +-------------+-----------------------------------------------------+
  723.       |    SioRTS   |  Sets, clears, or reads the Request to Send (RTS).  |
  724.       +-------------+-----------------------------------------------------+
  725.  
  726.       Syntax Function SioRTS(ByVal Port, ByVal Cmd) As Long
  727.              ' Port : Port selected.
  728.              ' Cmd  : RTS command (SET, CLEAR, or READ).
  729.  
  730.       Remark The SioRTS Function controls the Request to Send (RTS bit in
  731.              the modem control register.
  732.  
  733.              The RTS line is used by some error correcting modems to
  734.              implement hardware flow control.  RTS is dropped by the
  735.              computer to signal the modem not to send data, and is raised
  736.              to signal the modem to continue. RTS should be set when
  737.              communicating with a modem unless Flow Control is being used.
  738.  
  739.              Refer to the RS232/485 Serial Communications User's Manual
  740.              (ASYNC.TXT) for a discussion of flow control. Commands (see
  741.              WSC4VB.BAS) are:
  742.  
  743.                     SET_LINE  ASC("S") : set RTS (ON)
  744.                   CLEAR_LINE  ASC("C") : clear RTS (OFF)
  745.                    READ_LINE  ASC("R") : read RTS
  746.  
  747.       Return  IE_NOPEN : Port not opened. Call SioReset first.
  748.               IE_BADID : No such port.
  749.              WSC_RANGE : Command is not one of "S", "C", or "R".
  750.                      0 : RTS is OFF ("R" command).
  751.                     >0 : RTS is ON  ("R" command).
  752.  
  753.        Other See SioFlow and SioDTR.
  754.  
  755.       +------------+------------------------------------------------------+
  756.       | SioRxClear |  Clears the receive buffer.                          |
  757.       +------------+------------------------------------------------------+
  758.  
  759.       Syntax Function SioRxClear(ByVal Port) As Long
  760.              ' Port : Port selected.
  761.  
  762.       Remark The SioRxClear Function will delete any characters in the
  763.              receive buffer for the specified port.  After execution, the
  764.              receive buffer will be empty.
  765.  
  766.       Return IE_NOPEN : Port not opened. Call SioReset first.
  767.              IE_BADID : No such port.
  768.  
  769.        Other See SioRxQue.
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.      WSC4VB Reference Manual                                   Page 13
  781.  
  782.       +-------------+-----------------------------------------------------+
  783.       |  SioRxQue   |  Returns the number of bytes in the receive queue.  |
  784.       +-------------+-----------------------------------------------------+
  785.  
  786.       Syntax Function SioRxQue(ByVal Port) As Long
  787.              ' Port : Port selected.
  788.  
  789.       Remark The SioRxQue Function will return the number of characters in
  790.              the receive queue at the time of the call.
  791.  
  792.       Return IE_NOPEN : Port not opened. Call SioReset first.
  793.              IE_BADID : No such port.
  794.  
  795.        Other See SioTxQue.
  796.  
  797.  
  798.       +------------+------------------------------------------------------+
  799.       | SioStatus  |  Returns the serial port status.                     |
  800.       +------------+------------------------------------------------------+
  801.  
  802.       Syntax Function SioStatus(ByVal Port, ByVal Mask) As Long
  803.              ' Port : Port selected.
  804.              ' Mask : Error mask.
  805.  
  806.       Remark The SioStatus Function returns the serial port error status
  807.              corresponding to the Mask argument. The numerical values of
  808.              the PortMask constants are defined in WSC4VB.BAS.
  809.  
  810.                 WSC_RXOVER  : The receive queue overflowed.
  811.                 WSC_OVERRUN : An incoming byte was overwritten.
  812.                  WSC_PARITY : A parity error was detected (incoming byte)
  813.                   WSC_FRAME : A framing error was detected (incoming byte)
  814.                   WSC_BREAK : A break signal was detected.
  815.                  WSC_TXFULL : The transmit queue is full.
  816.  
  817.       Return IE_NOPEN : Port not opened. Call SioReset first.
  818.              IE_BADID : No such port.
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.      WSC4VB Reference Manual                                   Page 14
  841.  
  842.       +-----------+-------------------------------------------------------+
  843.       | SioTimer  |  Returns the system time in milliseconds.             |
  844.       +-----------+-------------------------------------------------------+
  845.  
  846.       Syntax Function SioTimer() As Long
  847.  
  848.       Remark The SioTimer function returns the system in milliseconds. Its
  849.              primary purpose is to compute the time between two events.
  850.  
  851.       Return The system time in milliseconds.
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.       +------------+------------------------------------------------------+
  859.       | SioTxClear |  Clears the transmitter buffer.                      |
  860.       +------------+------------------------------------------------------+
  861.  
  862.       Syntax Function SioTxClear(ByVal Port) As Long
  863.              ' Port : Port selected.
  864.  
  865.       Remark The SioTxClear Function will delete any characters in the
  866.              transmit buffer for the specified port.
  867.  
  868.              Once this function is called, any character in the transmit
  869.              buffer (put there by SioPutc) will be lost and therefore not
  870.              transmitted.
  871.  
  872.       Return IE_NOPEN : Port not opened. Call SioReset first.
  873.              IE_BADID : No such port.
  874.  
  875.        Other See SioTxQue.
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.      WSC4VB Reference Manual                                   Page 15
  901.  
  902.       +------------+------------------------------------------------------+
  903.       |  SioTxQue  |  Returns the number of bytes in the transmit queue.  |
  904.       +------------+------------------------------------------------------+
  905.  
  906.       Syntax Function SioTxQue(ByVal Port) As Long
  907.              ' Port : Port selected.
  908.  
  909.       Remark The SioTxQue Function will return the number of characters in
  910.              the transmit queue at the time of the call.
  911.  
  912.       Return IE_NOPEN : Port not opened. Call SioReset first.
  913.              IE_BADID : No such port.
  914.  
  915.        Other See SioRxQue.
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.       +------------+------------------------------------------------------+
  927.       | SioUnGetc  |  "Ungets" the last character read with SioGetc().    |
  928.       +------------+------------------------------------------------------+
  929.  
  930.       Syntax Function SioUnGetc(ByVal Port, ByVal Ch) As Long
  931.              ' Port : Port selected.
  932.              ' Ch   : Character to unget.
  933.  
  934.       Remark The SioUnGetc Function returns (.pushes.) the character back
  935.              into the serial input buffer.  The character pushed will be
  936.              the next character returned by SioGetc.  Only one character
  937.              can be pushed back. This Function works just like the
  938.              'ungetc' Function in the C language.
  939.  
  940.       Return IE_NOPEN : Port not opened. Call SioReset first.
  941.              IE_BADID : No such port.
  942.  
  943.        Other See SioReset.
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.      WSC4VB Reference Manual                                   Page 16
  961.  
  962.       +--------------+----------------------------------------------------+
  963.       | SioWinError  |  Return last Win32 error code & message text.      |
  964.       +--------------+----------------------------------------------------+
  965.  
  966.       SYNTAX Function SioWinError(ByVal Buffer As String,
  967.                                   ByVal Size As Long) As Long
  968.              ' Buffer : Pointer to messages buffer.
  969.              '   Size : Size of buffer.
  970.  
  971.       REMARK The SioWinError returns the last Win32 error code. If Buffer
  972.              is not NULL, it will also copy the corresponding text message
  973.              into 'Buffer' of size 'Size'.
  974.  
  975.       RETURN The Win32 numeric error code.
  976.  
  977.  
  978.  
  979.  
  980.                         WSC Error Codes
  981.  
  982.  
  983.       +---------------+---------------------------------------------+
  984.       |  WSC_NO_DATA  |  No incoming serial data is available.      |
  985.       |  WSC_RANGE    |  A parameter is out of range.               |
  986.       |  WSC_ABORTED  |  The shareware version of WSC corrupted.    |
  987.       |  WSC_WIN32ERR |  Win32 system error.                        |
  988.       +---------------+---------------------------------------------+
  989.       |  IE_BADID     |  No such port.                              |
  990.       |  IE_OPEN      |  Port already opened.                       |
  991.       |  IE_NOPEN     |  Port not opened. Call SioReset first.      |
  992.       |  IE_MEMORY    |  Cannot allocate memory for queues.         |
  993.       |  IE_DEFAULT   |  Error in default parameters.               |
  994.       |  IE_HARDWARE  |  Hardware not present.                      |
  995.       |  IE_BYTESIZE  |  Unsupported byte size.                     |
  996.       |  IE_BAUDRATE  |  Unsupported baud rate.                     |
  997.       +---------------+---------------------------------------------+
  998.  
  999.  
  1000.       The WSC_ABORTED error occurs in the shareware version only if there
  1001.       is a problem displaying the shareware screen.
  1002.  
  1003.       The WSC_WIN32ERR error code is returned only for Win32 system errors.
  1004.       Call SioWinError to retrieve the error message.
  1005.  
  1006.       See Error.BAS to display the text of the error message.
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.      WSC4VB Reference Manual                                   Page 17
  1021.  
  1022.       +-----------+-------------------------------------------------------+
  1023.       | mioBreak  |  Aborts the Modem I/O state driver.                   |
  1024.       +-----------+-------------------------------------------------------+
  1025.  
  1026.       Syntax Function mioBreak(ByVal Port) As Long
  1027.              ' Port : Port selected.
  1028.  
  1029.       Remark Forces the MIO driver to the IDLE state, abandoning any work
  1030.              in progress (if any). Used to abort mioSendTo, mioQuiet, and
  1031.              mioWaitFor functions.
  1032.  
  1033.       Return MIO_IDLE.
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.       +------------+------------------------------------------------------+
  1042.       | mioDriver  |  Modem I/O state driver.                             |
  1043.       +------------+------------------------------------------------------+
  1044.  
  1045.       Syntax Function mioDriver(ByVal Port) As Long
  1046.              ' Port : Port selected.
  1047.  
  1048.       Remark Executes the next state of any previously started MIO Function
  1049.              such as mioSendTo, mioWaitFor, and mioQuiet. Returns MIO_IDLE
  1050.              (defined in MIO32.BAS) if ready not running, MIO_RUNNING if
  1051.              running, and anything else is a character from the modem that
  1052.              can be displayed if wanted.
  1053.  
  1054.       Return  MIO_IDLE : if the driver is ready for the next mioSendTo,
  1055.                            mioWaitFor, or mioQuiet.
  1056.              MIO_RUNNING : if the driver is not idle.
  1057.                   <else> : if the driver is not idle, and the returned
  1058.                            character was received from the modem.
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.      WSC4VB Reference Manual                                   Page 18
  1081.  
  1082.       +-----------+-------------------------------------------------------+
  1083.       | mioQuiet  |  Waits for Modem I/O state driver.                    |         *
  1084.       +-----------+-------------------------------------------------------+
  1085.  
  1086.       Syntax Function mioQuiet(ByVal Port, ByVal Wait As Long) As Long
  1087.              ' Port : Port selected.
  1088.              ' Wait : Wait in milliseconds.
  1089.  
  1090.       Remark The mioQuiet Function waits for continuous quiet [no incoming
  1091.              serial data] of 'Wait' milliseconds before returning.  Any
  1092.              incoming character while mioQuiet is running is lost.
  1093.  
  1094.       Return TRUE.
  1095.  
  1096.  
  1097.  
  1098.  
  1099.       +------------+------------------------------------------------------+
  1100.       | mioResult  |  Returns result of last mioWaitFor.                  |
  1101.       +------------+------------------------------------------------------+
  1102.  
  1103.       Syntax Function mioResult(ByVal Port) As Long
  1104.              ' Port : Port selected.
  1105.  
  1106.       Remark The mioResult Function returns the result of the last
  1107.              mioWaitFor Function. This Function should not be called until
  1108.              the driver returns MIO_IDLE. See the remarks section of the
  1109.              mioWaitFor Function for an example.
  1110.  
  1111.       Return  0 : False (last WaitFor not matched)
  1112.              !0 : '0' if first substring matched, '1' if second substring
  1113.              matched, etc.
  1114.  
  1115.        Other See mioWaitFor.
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.      WSC4VB Reference Manual                                   Page 19
  1141.  
  1142.       +-----------+-------------------------------------------------------+
  1143.       | mioSendTo |  Sends string to modem.                               |
  1144.       +-----------+-------------------------------------------------------+
  1145.  
  1146.       Syntax Function mioSendTo(ByVal Port, ByVal Pace,
  1147.                                 ByVal Text As String) As Long
  1148.              ' Port : Port selected.
  1149.              ' Pace : The inter-character delay in milliseconds.
  1150.              ' Text : The string to send.
  1151.  
  1152.       Remark The mioSendTo Function sends the characters in the string
  1153.              'Text' to serial output. There is a delay of 'Pace'
  1154.              milliseconds between characters.
  1155.  
  1156.              Three characters in 'Text' are interpreted as:
  1157.  
  1158.              '^' : next character is control char (^A for 0x01)
  1159.              '!' : replaced with carriage return.
  1160.              '~' : removed from string (delay 1/2 second).
  1161.  
  1162.       Return TRUE.
  1163.  
  1164.  
  1165.  
  1166.       +-------------+-----------------------------------------------------+
  1167.       | mioWaitFor  |  Waits for continuous quiet.                        |
  1168.       +-------------+-----------------------------------------------------+
  1169.  
  1170.       Syntax Function mioWaitFor(ByVal Port, ByVal Wait,
  1171.                                  ByVal Text As String) As Long
  1172.  
  1173.              ' Port : Port selected.
  1174.              ' Wait : Total time to wait for response (milliseconds).
  1175.              ' Text : The expected response string.
  1176.  
  1177.       Remark The mioWaitFor Function waits for characters from serial
  1178.              input that match the string 'Text'. A total of 'Wait'
  1179.              milliseconds are allowed before timing out and returning FALSE
  1180.              (0). The string comparison is NOT case sensitive.
  1181.  
  1182.              For example, to wait up to one minute for 'CONNECT', 'NO
  1183.              CARRIER', or 'BUSY' from the modem after dialing a number.
  1184.  
  1185.              Code = mioWaitFor(ByVal Port,60000,'CONNECT|NO CARRIER|BUSY')
  1186.  
  1187.              The Function mioDriver() must be called until MIO_IDLE is
  1188.              returned. Then mioResult() is called to get the result of the
  1189.              mioWaitFor.  A value of 0 indicates that neither 'CONNECT',
  1190.              'BUSY', nor 'NO CARRIER' was received. A non-zero value
  1191.              indicates that one of the three sub-strings was received.  A
  1192.              '0' is returned if 'CONNECT' was seen, '1' is returned if 'NO
  1193.              CARRIER' was seen, and '2' is returned if 'BUSY' was seen.
  1194.  
  1195.       Return TRUE.
  1196.  
  1197.        Other See mioResult.
  1198.  
  1199.  
  1200.      WSC4VB Reference Manual                                   Page 20
  1201.  
  1202.       +---------+---------------------------------------------------------+
  1203.       | xyAbort | Aborts the XYDRIVER state driver.                       |
  1204.       +---------+---------------------------------------------------------+
  1205.  
  1206.       Syntax Function xyAbort(ByVal Port) As Long
  1207.              ' Port :  Port selected.
  1208.  
  1209.       Remark The xyAbort Function forces the driver to IDLE, terminating
  1210.              any file transfer which may be in progress.
  1211.  
  1212.       Return XY_NO_ERROR (0).
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.       +-----------+-------------------------------------------------------+
  1220.       | xyAcquire | Prepares the state driver for operation.              |
  1221.       +-----------+-------------------------------------------------------+
  1222.  
  1223.       Syntax Function xyAcquire(ByVal Port) As Long
  1224.              ' Port :  Port selected.
  1225.  
  1226.  
  1227.       Remark The xyAcquire Function initializes the driver for subsequent
  1228.              use. This should be the first driver Function called.
  1229.  
  1230.       Return =0 : No error (XY_NO_ERROR).
  1231.              <0 : XYDRIVER error. See XYDRIVER Error Codes.
  1232.  
  1233.        Other See xyRelease.
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.      WSC4VB Reference Manual                                   Page 21
  1261.  
  1262.       +----------+--------------------------------------------------------+
  1263.       | xyDebug  | Set the driver debug level.                            |
  1264.       +----------+--------------------------------------------------------+
  1265.  
  1266.       Syntax Function xyDebug(ByVal DebugLevel) As Long
  1267.              ' DebugLevel : Debug level value.
  1268.  
  1269.       Remark The xyDebug Functions sets the driver debug level as follows:
  1270.  
  1271.              DebugLevel :  Meaning
  1272.                  0         Only error messages are generated [default].
  1273.                  1         Minimal debug messages are generated.
  1274.                  2         Maximal debug messages are generated.
  1275.  
  1276.              Debug messages are retrieved using the xyGetMessage Function.
  1277.  
  1278.       Returns New debug level [0,1,2]
  1279.  
  1280.  
  1281.  
  1282.  
  1283.       +----------+--------------------------------------------------------+
  1284.       | xyDriver | XMODEM / YMODEM state driver.                          |
  1285.       +----------+--------------------------------------------------------+
  1286.  
  1287.       Syntax Function xyDriver(ByVal Port) As Long
  1288.              ' Port :  Port selected.
  1289.  
  1290.       Return    XY_IDLE : A transfer is not underway.
  1291.              XY_RUNNING : A transfer is underway.
  1292.  
  1293.       Remark The xyDriver Function drives the state engine. It is normally
  1294.              called within a timer loop. Note that xyDriver never returns
  1295.              an error code.
  1296.  
  1297.              xyDriver can be called as often as wanted whether or not a
  1298.              file transfer was initiated.
  1299.  
  1300.        Other See xyStartTx and xyStartRx.
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.      WSC4VB Reference Manual                                   Page 22
  1321.  
  1322.       +---------------+---------------------------------------------------+
  1323.       | xyGetFileName |  Get the filename                                 |
  1324.       +---------------+---------------------------------------------------+
  1325.  
  1326.       SYNTAX Function xyGetFileName(Buffer As string, ByVal Size)
  1327.              ' Buffer : Filename buffer.
  1328.              ' Size   : Size of Filename buffer.
  1329.  
  1330.       REMARK The xyGetFileName function gets the current filename. This
  1331.              function is designed for use on the receive side YMODEM
  1332.              protocol, where the filename is received as part of the first
  1333.              packet (packet #0). See TERM.BAS for an example of use.
  1334.  
  1335.       RETURN  TRUE : A message was copied into Buffer.
  1336.              FALSE : No messages are available.
  1337.  
  1338.        OTHER See xyGetParameter.
  1339.  
  1340.  
  1341.  
  1342.  
  1343.       +--------------+----------------------------------------------------+
  1344.       | xyGetMessage |  Get next XYDRIVER message.                        |
  1345.       +--------------+----------------------------------------------------+
  1346.  
  1347.       Syntax Function xyGetMessage(Buffer As String, ByVal Size) As Long
  1348.              ' Buffer : Message buffer.
  1349.              ' Size   : Size of message buffer.
  1350.  
  1351.       Remark The xyGetMessage Function retrieves the next message from the
  1352.              driver message queue. Refer to the XMR.BAS example program for
  1353.              an sample of using xyGetMessage.
  1354.  
  1355.       Return  TRUE : A message was copied into Buffer.
  1356.              FALSE : No messages are available.
  1357.  
  1358.        Other See xyDebug.
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.      WSC4VB Reference Manual                                   Page 23
  1381.  
  1382.       +----------------+--------------------------------------------------+
  1383.       | xyGetParameter | Retrieves driver parameter.                      |
  1384.       +----------------+--------------------------------------------------+
  1385.  
  1386.       Syntax Function xyGetParameter(ByVal Port, ByVal Parameter) As Long
  1387.              ' Port      : Port Selected.
  1388.              ' Parameter : Parameter to return.
  1389.  
  1390.       Remark The driver parameter corresponding to the following table is
  1391.              returned.
  1392.  
  1393.                        Parameter :  Description
  1394.                XY_GET_ERROR_CODE : Driver error code (see XYDRIVER.BAS)
  1395.               XY_GET_ERROR_STATE : Error state (if in error).
  1396.                    XY_GET_PACKET : Current packet number.
  1397.                     XY_GET_STATE : Current state (see XYDRIVER.BAS).
  1398.                 XY_GET_FILE_SIZE : File size.
  1399.                  XY_GET_NBR_NAKS : Number of packets ACKed.
  1400.                  XY_GET_LAST_GET : Last incoming (serial) character.
  1401.                  XY_GET_LAST_PUT : Last outgoing (serial) character.
  1402.                 XY_GET_GET_COUNT : Number of incoming characters (bytes).
  1403.                 XY_GET_PUT_COUNT : Number of outgoing characters (bytes).
  1404.              XY_GET_DRIVER_COUNT : Number times xyDriver() was called.
  1405.                               -1 : Cannot recognize parameter.
  1406.  
  1407.              The xyGetParameter Function can be used to check the state of
  1408.              the driver. For example:
  1409.  
  1410.             (1) xyGetParameter(ByVal Port,XY_GET_STATE) returns XY_IDLE if idle.
  1411.             (2) xyGetParameter(ByVal Port,XY_GET_ERROR_CODE) returns the driver
  1412.                 error code if an error has occurred or XY_NO_ERROR (0)
  1413.                 otherwise.
  1414.  
  1415.       Return See above.
  1416.  
  1417.  
  1418.       +-----------+-------------------------------------------------------+
  1419.       | xyRelease | Releases driver port.                                 |
  1420.       +-----------+-------------------------------------------------------+
  1421.  
  1422.       Syntax Function xyRelease(ByVal Port) As Long
  1423.              ' Port : Port selected.
  1424.  
  1425.       Remark The xyRelease Function releases a port that was previously
  1426.              acquired with xyAcquire. This Function should be called before
  1427.              calling the WSC Function SioDone.
  1428.  
  1429.       Return  0 : No error (XY_NO_ERROR).
  1430.              <0 : XYDRIVER error. See .XYDRIVER Error Codes.
  1431.  
  1432.        Other See xyAcquire.
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.      WSC4VB Reference Manual                                   Page 24
  1441.  
  1442.       +----------------+--------------------------------------------------+
  1443.       | xySetParameter | Retrieves driver parameter.                      |
  1444.       +----------------+--------------------------------------------------+
  1445.  
  1446.       SYNTAX Function xySetParameter(ByVal Port, ByVal ParmName,
  1447.                                      ByVal ParmValue) As Long
  1448.              ' Port      : Port Selected.
  1449.              ' ParmName  : Parameter Name.
  1450.              ' ParmValue : Parameter Value.
  1451.  
  1452.       REMARK The ParmValue corresponding to the following table is set.
  1453.  
  1454.                         ParmName : Description
  1455.                  XY_SET_NAK_RATE : Sets the prompt delay (in seconds).
  1456.                  XY_SET_EOF_CHAR : Sets the XMODEM pad character.
  1457.                               -1 : Cannot recognize parameter.
  1458.  
  1459.              The XY_SET_NAK_RATE parameter sets the delay (in seconds)
  1460.              between prompts that the receiver transmits to the sender to
  1461.              start the file transfer. The legal range is 1 to 10 seconds.
  1462.  
  1463.              The XY_SET_EOF_CHAR parameter sets the pad character used by
  1464.              XMODEM in padding the last packet to 128 bytes. The normal
  1465.              value is control-Z (hex 1A). For example, to set the pad
  1466.              character to zeros:
  1467.  
  1468.                  Code = xySetParameter(COM1, XY_SET_EOF_CHAR, 0)
  1469.  
  1470.       +-----------+-------------------------------------------------------+
  1471.       | xyStartRx | Start XMODEM or YMODEM receive.                       |
  1472.       +-----------+-------------------------------------------------------+
  1473.  
  1474.       Syntax Function xyStartRx(ByVal Port, ByVal Filename As String,
  1475.                                 ByVal NCGchar, ByVal Batch) As Long
  1476.              ' Port     : Port to use.
  1477.              ' Filename : File to receive (XMODEM only).
  1478.              ' NCGchar  : NAK or ASC("C").
  1479.              ' Batch    : YMODEM flag (T/F).
  1480.  
  1481.       Remark The xyStartRx starts the XMODEM or YMODEM file receive. Once
  1482.              started, calls to xyDriver are made to execute the next state
  1483.              (or states). The xyStartTx Function returns immediately.
  1484.  
  1485.              Protocol   :  NCGchar   BatchFlag  :  Comments
  1486.              XMODEM     :   NAK        FALSE       Standard XMODEM
  1487.              XMODEM/CRC :   ASC("C")        FALSE
  1488.              XMODEM/1K  :   ASC("C")        FALSE
  1489.              YMODEM     :   ASC("C")        TRUE        Standard YMODEM
  1490.  
  1491.              The xyStart Function is used to receive a file using XMODEM or
  1492.              YMODEM.
  1493.  
  1494.       Return =0 : No error (XY_NO_ERROR).
  1495.              <0 : Driver error. See .XYDRIVER Error Codes. a list of errors.
  1496.  
  1497.        Other See xyStartTx and xyDriver.
  1498.  
  1499.  
  1500.      WSC4VB Reference Manual                                   Page 25
  1501.  
  1502.       +-----------+-------------------------------------------------------+
  1503.       | xyStartTx | Start XMODEM or YMODEM transmit.                      |
  1504.       +-----------+-------------------------------------------------------+
  1505.  
  1506.       Syntax Function xyStartTx(ByVal Port, ByVal Filename As String,
  1507.                                 ByVal OneKflag, ByVal Batch) As Long
  1508.              ' Port     : Port to use.
  1509.              ' Filename : File to send.
  1510.              ' OneK     : Want 1K blocks (T/F).
  1511.              ' Batch    : YMODEM flag (T/F).
  1512.  
  1513.       Remark The xyStartTx starts the XMODEM or YMODEM file send. Once
  1514.              started, calls to xyDriver are made to execute the next state
  1515.              (or states). The xyStartTx Function returns immediately.
  1516.  
  1517.              Protocol   :  OneKflag  BatchFlag : Comments
  1518.              XMODEM     :   FALSE      FALSE     Standard XMODEM
  1519.              XMODEM/CRC :   FALSE      FALSE
  1520.              XMODEM/1K  :   TRUE       FALSE
  1521.              YMODEM     :   TRUE       TRUE      Standard YMODEM
  1522.  
  1523.       Return =0 : No error (XY_NO_ERROR).
  1524.              <0 : Driver error. See XYDRIVER.BAS for a list of errors.
  1525.  
  1526.        Other See xyStartRx and xyDriver.
  1527.  
  1528.                          XYDRV Error Codes
  1529.  
  1530.       Error codes are always negative, except for 'no error'. Most of these
  1531.       error conditions rarely occur. Also note that XYDRV functions can
  1532.       return WSC errors. An error message is queued when an error occurs
  1533.       which can be retrieved with xyGetMessage.
  1534.  
  1535.       The numeric values for error codes can be found in XYDRV32.BAS.
  1536.  
  1537.       +--------------------------+----------------------------------------+
  1538.       |              XY_NO_ERROR | No error. (0)                          |
  1539.       |         XY_UNKNOWN_ERROR | Unknown error.                         |
  1540.       |  XY_ALREADY_ACTIVE_ERROR | Port already acquired.                 |
  1541.       |     XY_CANNOT_OPEN_ERROR | Cannot open specifed file.             |
  1542.       |      XY_EMPTY_FILE_ERROR | Specified file is empty.               |
  1543.       | XY_NO_STARTUP_CHAR_ERROR | Must specify NAK or "C".               |
  1544.       |         XY_NOT_NCG_ERROR | Expected NAK or "C".                   |
  1545.       |       XY_DISK_READ_ERROR | Error reading disk.                    |
  1546.       |      XY_NO_EOT_ACK_ERROR | EOT was not ACKed.                     |
  1547.       |        XY_INTERNAL_ERROR | Internal error!                        |
  1548.       |       XY_CANCELLED_ERROR | Other side cancelled.                  |
  1549.       |     XY_OUT_OF_SYNC_ERROR | Protocol has lost synchronization.     |
  1550.       |         XY_RETRIES_ERROR | Packet retry limit was exceeded.       |
  1551.       |  XY_BAD_PACKET_NBR_ERROR | Incorrect packet number.               |
  1552.       |       XY_TIMED_OUT_ERROR | Timed out waiting for other side.      |
  1553.       |    XY_NO_SUCH_FILE_ERROR | No such file.                          |
  1554.       |      XY_NOT_ACTIVE_ERROR | Port not acquired by xyAcquire.        |
  1555.       |      XY_PORT_RANGE_ERROR | Port number out of range.              |
  1556.       +--------------------------+----------------------------------------+
  1557.  
  1558.  
  1559.  
  1560.      WSC4VB Reference Manual                                   Page 26
  1561.  
  1562.       +----------+--------------------------------------------------------+
  1563.       | ascAbort | Aborts the Ascii state driver.                         |
  1564.       +----------+--------------------------------------------------------+
  1565.  
  1566.       Syntax Function ascAbort() As Long
  1567.  
  1568.       Remark The ascAbort function forces the ASCII driver to IDLE,
  1569.              terminating any file transfer which may be in progress.
  1570.  
  1571.       Return none.
  1572.  
  1573.  
  1574.  
  1575.       +-----------+-------------------------------------------------------+
  1576.       | ascDriver | Ascii state driver.                                   |
  1577.       +-----------+-------------------------------------------------------+
  1578.  
  1579.       Syntax Function ascDriver() As Long
  1580.  
  1581.       Return 1 : IDLE (A transfer is not underway).
  1582.              0 : Running (A transfer is underway).
  1583.  
  1584.       Remark The ascDriver function drives the state engine. It executes
  1585.              the next driver state, and is typically called from within a
  1586.              timer loop.
  1587.  
  1588.              ascDriver can be called as often as wanted whether or not a
  1589.              file transfer was initiated. Note that ascDriver never
  1590.              returns an error code.
  1591.  
  1592.        Other See ascStartTx and ascStartRx.
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.      WSC4VB Reference Manual                                   Page 27
  1621.  
  1622.       +---------------+---------------------------------------------------+
  1623.       | ascGetMessage |  Get next Ascii driver message.                   |
  1624.       +---------------+---------------------------------------------------+
  1625.  
  1626.       Syntax Function ascGetMessage(ByVal Buffer As String, ByVal Size)
  1627.                                     As Long
  1628.              ' Buffer : Message buffer.
  1629.              ' Size   : Size of message buffer.
  1630.  
  1631.       Remark The ascGetMessage function retieves the next message from the
  1632.              driver message queue.
  1633.  
  1634.       Return  TRUE : A message was copied into Buffer.
  1635.              FALSE : No messages are available.
  1636.  
  1637.        Other See ascGetParameter.
  1638.  
  1639.  
  1640.  
  1641.       +-----------------+-------------------------------------------------+
  1642.       | ascGetParameter | Retrieves driver parameter.                     |
  1643.       +-----------------+-------------------------------------------------+
  1644.  
  1645.       Syntax Function ascGetParameter(ByVal Parameter) As Long
  1646.              ' Parameter : Parameter to return.
  1647.  
  1648.       Remark The driver parameter corresponding to the following table is
  1649.              returned.
  1650.  
  1651.                        Parameter :  Desciption
  1652.                ASC_GET_ERROR_CODE : Driver error code (see ASCDRV.BAS)
  1653.               ASC_GET_ERROR_STATE : Error state (if in error).
  1654.                     ASC_GET_STATE : Current state (ss ASCDRV.BAS).
  1655.                                -1 : Cannot recognize parameter.
  1656.  
  1657.              The ascGetParameter function can be used to check the state of
  1658.              the driver. For example:
  1659.  
  1660.             (1) ascGetParameter(Port,ASC_GET_STATE) returns the current
  1661.                 state.
  1662.             (2) ascGetParameter(Port,ASC_GET_ERROR_CODE) returns the driver
  1663.                 error code if an error has occurred or ASC_NO_ERROR (0)
  1664.                 otherwise.
  1665.  
  1666.       Return See above.
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.      WSC4VB Reference Manual                                   Page 28
  1681.  
  1682.       +---------+---------------------------------------------------------+
  1683.       | ascInit | Start Ascii receive.                                    |
  1684.       +---------+---------------------------------------------------------+
  1685.  
  1686.       Syntax Function ascInit(ByVal Port, ByVal RxBufSize,
  1687.                               ByVal xFlag) As Long
  1688.              ' Port : Port selected.
  1689.              ' RxBufSize : RX buffer size
  1690.              ' xFlag : Perform XON/XOFF flag (T/F).
  1691.  
  1692.       Remark The ascInit initializes the Ascii driver for subsequent use.
  1693.              RxBufSize is the size of the receive buffer as passed to
  1694.              SioReset. xFlag is used to request that XON/XOFF flow control
  1695.              be performed by the Ascii driver.
  1696.  
  1697.       Return =0 : No error (ASC_NO_ERROR).
  1698.              <0 : Driver error. See "Error Codes" for a list of errors.
  1699.  
  1700.        Other See ascStartTx and ascDriver.
  1701.  
  1702.       +------------+------------------------------------------------------+
  1703.       | ascStartRx | Start Ascii receive.                                 |
  1704.       +------------+------------------------------------------------------+
  1705.  
  1706.       Syntax function ascStartRx(ByVal FileName As String,
  1707.                                  ByVal TermChar, ByVal FirstWait,
  1708.                                  ByVal CharWait, ByVal EchoFlag) As Long
  1709.              ' Filename : File to receive
  1710.              ' TermChar : Termination character ($00 if none)
  1711.              ' FirstWait: Max seconds to wait for 1st incoming char
  1712.              ' CharWait : Max seconds between chars to wait
  1713.              ' EchoFlag : Echo to display if true
  1714.  
  1715.       Remark The ascStartRx starts the ASCII file receive. Once
  1716.              started, calls to ascDriver are made to execute the next state
  1717.              (or states). The ascStartTx function returns immediately.
  1718.  
  1719.              You may need to prompt the sender by sending a carriage return
  1720.              ($0d) or XON character ($11).
  1721.              example.
  1722.  
  1723.       Return =0 : No error (ASC_NO_ERROR).
  1724.              <0 : Driver error. See "Error Codes" for a list of errors.
  1725.  
  1726.        Other See ascStartTx and ascDriver.
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.      WSC4VB Reference Manual                                   Page 29
  1741.  
  1742.       +------------+------------------------------------------------------+
  1743.       | ascStartTx | Start Ascii transmit.                                |
  1744.       +------------+------------------------------------------------------+
  1745.  
  1746.       Syntax Function ascStartTx(ByVal FileName As String,
  1747.                                  ByVal CharPace, ByVal TermChar,
  1748.                                  ByVal EchoFlag) As Long
  1749.              ' Filename : File to receive
  1750.              ' CharPace : Delay in millisecs between chars
  1751.              ' TermChar : Termination character ($00 if none)
  1752.              ' EchoFlag : Echo to display if true
  1753.  
  1754.       Remark The ascStartTx starts the Ascii file send. Once
  1755.              started, calls to ascDriver are made to execute the next state
  1756.              (or states). The ascStartTx function returns immediately.
  1757.  
  1758.       Return =0 : No error (ASC_NO_ERROR).
  1759.              <0 : Driver error. See XTDRIVER.BAS for a list of errors.
  1760.  
  1761.        Other See ascStartRx and ascDriver.
  1762.  
  1763.                          ASCDRV Error Codes
  1764.  
  1765.       Error codes are always negative, except for 'no error'. Most of these
  1766.       error conditions rarely occur. Also note that ASCII DRIVER functions
  1767.       can return WSC errors. An error message is queued when an error
  1768.       occurs which can be retrieved with ascGetMessage.
  1769.  
  1770.       The numeric values for error codes can be found in AscDriver.bas.
  1771.  
  1772.       +------------------------+------------------------------------------+
  1773.       |           ASC_NO_ERROR | No error. (0)                            |
  1774.       |   ASC_NOT_ACTIVE_ERROR | ascInit not previously called.           |
  1775.       |  ASC_CANNOT_OPEN_ERROR | Cannot open specifed file.               |
  1776.       |      ASC_DISK_IO_ERROR | Error reading or writting disk.          |
  1777.       |     ASC_INTERNAL_ERROR | Internal error!                          |
  1778.       |     ASC_NOT_OPEN_ERROR | File not open.                           |
  1779.       +------------------------+------------------------------------------+
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.  
  1800.      WSC4VB Reference Manual                                   Page 30
  1801.  
  1802.